{include file="common/_header-css"}
<body>
<div class="layui-fluid">
    <div class="layui-row">
        <form class="layui-form">

            <div class="layui-form-item">
                <label for="" class="layui-form-label">
                    <span class="x-red">*</span>管理员账号</label>
                <div class="layui-input-inline">
                    <input type="text" value="{:session('user.account')}"  class="layui-input" disabled >
                </div>
                <div class="layui-form-mid layui-word-aux">
                    <span class="x-red">*</span></div>
            </div>

            <div class="layui-form-item">
                <label for="password" class="layui-form-label">
                    <span class="x-red">*</span>密码</label>
                <div class="layui-input-inline">
                    <input type="password" id="password" name="password" required="" lay-verify="pass" placeholder="修改密码" autocomplete="off" class="layui-input">
                </div>
                <div class="layui-form-mid layui-word-aux">6到16个字符</div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label"></label>
                <button class="layui-btn" lay-filter="add" lay-submit="">修改</button>
            </div>
        </form>
    </div>
</div>
<script>
    layui.use(['form', 'layer','jquery'],
        function() {
            $ = layui.jquery;
            var form = layui.form,
                layer = layui.layer;

            //监听提交
            form.on('submit(add)',
                function(data) {

                    if (data.field.password == "") {
                        layer.msg('管理员密码不能为空!',{icon:5,time:800});
                        return false;
                    }
                    $.post('{:url(\'index/user_info\')}',data.field,function (res) {
                        if (res.code == 200) {
                            layer.alert(res.msg, {icon: 6}, function() {
                                xadmin.father_reload();
                            });
                        }else{
                            layer.msg(res.msg,{icon:5,time:500});
                        }

                    });

                    return false;
                });

        });
</script>
</body>

</html>